1. Technical Field
The present invention relates to a method and system for data processing in general, and in particular to a method and system for processing bytecodes within a computer system. Still more particularly, the present invention relates to a method and system for translating exception handling semantics of a bytecode class file within a computer system.
2. Description of the Prior Art
With the advent of wide-area networks such as the Internet, a new class of high-level programming languages has been developed in order to support the diverse hardware and software platforms within these wide-area networks. Programs written in this new class of high-level programming languages are generally compiled into bytecodes that can be interpreted in a user's computer system by a bytecode interpreter, typically in the form of software, during runtime. Java.TM. is an example of a high-level programming language that can be compiled into bytecodes, and Java.TM. has been gaining popularity within the industry in recent years.
There are several characteristics that are unique to Java.TM. bytecodes. First, Java.TM. bytecodes are data type specific and utilize separate opcodes to specify the same basic operation for different primitive data types. Accordingly, a group of bytecodes are included within the Java.TM. instruction set to perform each basic function (for example, to add two numbers), with each bytecode being utilized to process only data of a particular data type. In addition, the Java.TM. bytecode instruction set is notable for not including certain instructions that are commonly found in other high-level programming languages. For example, the Java.TM. instruction set does not include a "goto" instruction or an instruction for modifying objects references or creating new object references (other than copying an existing object reference). These kinds of restrictions in the Java.TM. bytecode instruction set help to ensure that all Java.TM. bytecode programs will utilize data in a manner that is consistent with the data type specific instructions in the Java.TM. bytecode instruction set.
As mentioned above, bytecodes are typically interpreted in a user's computer system by a software bytecode interpreter during runtime. In order to improve performance, a bytecode program can also be compiled by an appropriate compiler into native executable modules after the bytecodes have been translated into instructions of a compilable high-level software language. Be that as it may, sometimes the speed improvement may not be as significant as desired because some of the bytecodes, such as the exception handling semantics, are not easily optimized by the compiler. The exception handling semantics, embedded within an exception handling structure (or exception framelist) of a bytecode class file, are designed to allow the bytecode interpreter to handle exceptions that occur during an enclosed try statement. However, the exception handling structure prevents the translated high-level code from being optimized by the compiler because the artificial exception ranges kept in the exception table of a method preclude the final natively compiled instructions from being rescheduled for optimal performance. The present disclosure provides an improved method for translating exception handling semantics within a bytecode class file.